begintalkscript;

variables;
short pcs,others_ok,twondx;
string custom_m;

begintalknode 1;
	state = -1;
	nextstate = 1;
	question = "Dr. Wu";
	text1 = "Dr. Wu is sitting here patiently with his hands folded.";
	code = 
		if(get_flag(21,1) == 0){
			set_flag(21,1,1);
			remove_string(1);
			clear_buffer();
			append_string("_Finally, we have a chance to hold a leisurely discussion.  At least, I hope we do.  At any rate, my name as you know is Dr. Wu.  And you, I presume, are ");
			pcs = 0;
			while(pcs <= 3){
				if(char_ok(pcs) == TRUE){
					others_ok = (pcs + 1);
					twondx = 0;
					while(others_ok < 4 && twondx < 2){
						if(char_ok(others_ok) == 1){
							twondx = (twondx + 1);
						}
						others_ok = (others_ok + 1);
					}
					if(twondx == 1){
						append_char_name(pcs);
						append_string(" and ");
					}
					if(twondx > 1){
						append_char_name(pcs);
						append_string(", ");
					}
					if(twondx == 0){
						append_char_name(pcs);
					}
				}
				pcs = (pcs + 1);
			}
			append_string(".  It's a pleasure to meet you");
			if(party_size() == 2)
				append_string(" both");
			if(party_size() > 2)
				append_string(" all");
			append_string("._");
			get_buffer_text(custom_m);
			message_dialog("Dr. Wu is patiently waiting with his hands folded.  He seems a great deal more patient than any of the other villains scampering in this stygian pit.",custom_m);
		}
break;

begintalknode 2;
	state = 1;
	nextstate = -1;
	condition = ((get_flag(22,1) == 0) && (party_size() == 1)) && (get_flag(21,1) < 7);
	question = "Let's cut the crap-- how do I get to The Immortal?";
	text1 = "_You think you're ready to take him on?  Fine.  The portal to your south is now open to you.  But I'll warn you:  He is cunning.  You simply are not going to win, no matter what you think._";
	text2 = "_Though best of luck regardless.  This battle does not matter in the long run...  I'd rather see your morale rise with a temporary victory._";
	code = 
		set_flag(22,1,1);
break;

begintalknode 3;
	state = 1;
	nextstate = -1;
	condition = ((get_flag(22,1) == 0) && (party_size() > 1)) && (get_flag(21,1) < 7);
	question = "Let's cut the crap-- how do we get to The Immortal?";
	text1 = "_You think you're ready to take him on?  Fine.  The portal to your south is now open to you.  But I'll warn you:  He is cunning.  You simply are not going to win, no matter what you think._";
	text2 = "_Though best of luck regardless.  This battle does not matter in the long run...  I'd rather see your morale rise with a temporary victory._";
	code = 
		set_flag(22,1,1);
break;

begintalknode 4;
	state = 1;
	nextstate = -1;
	condition = get_flag(21,1) == 1;
	question = "Who are you?";
	text1 = "_I am...  old.  Older than you knew anyone could live for.  In fact, most of us rakshasi whom you've seen thus far are._";
	text2 = "_There are other details about myself that I will spare you...  suffice it to say, however, that my title as 'Doctor' is not merely ornamental.  I don't know how useful I am to these people, but there is a reason why I am kept around._";
	text3 = "_Although you should probably ask me something else next, since I'm not particularly liable to continue the discussion in this vein any longer._";
	code = 
		set_flag(21,1,2);
break;

begintalknode 5;
	state = 1;
	nextstate = -1;
	condition = get_flag(21,1) == 2;
	question = "What's going on here?";
	text1 = "_We're going to take over the Empire.  Gain power.  And ultimately, that's what will allow us to change the world._";
	text2 = "_I bet you've figured out how we're gaining power up until now, so I won't dwell on it.  Our future plans, or so I am told, are far grander._";
	text3 = "_It's a gambit, I must admit.  But so far, all of the pieces have fallen into place._";
	code = 
		set_flag(21,1,3);
break;

begintalknode 6;
	state = 1;
	nextstate = -1;
	condition = get_flag(21,1) == 3;
	question = "All the pieces?  How so?";
	text1 = "_Footracer is dead, Abidan is dead, Stewart I is intimidated, and Katothen has had the wool pulled over his eyes._";
	text2 = "_All it took to keep him out of our affairs was to claim that the Master was hiding nearby.  Just put some red stars at the entrance of a fumarole and the boy keeps his distance._";
	code = 
		set_flag(21,1,4);
break;

begintalknode 7;
	state = 1;
	nextstate = -1;
	condition = get_flag(21,1) == 4;
	question = "The Master?  Does this mean that the 'beacon' nearby is fake?";
	text1 = "_The Master is real, if that's what you're asking, although I could hardly tell you where to find him.  But he is certainly not hiding in this backwater nowhere._";
	text2 = "_I don't blame Katothen for his apprehension, however.  If I were in his position, I would hate to deal with the Master either.  Unfortunately, his unwillingness to call our bluff has resulted in an unfettered operation._";
	text3 = "_Essentially, we made it seem like our Master was hiding nearby simply to scare Katothen into not acting with full force.  And he bought it._";
	code = 
		set_flag(21,1,5);
break;

begintalknode 8;
	state = 1;
	nextstate = -1;
	condition = (get_flag(21,1) == 5) && (party_size() == 1);
	question = "Why tell me all of these things?";
	text1 = "_The Immortal said that we could trust you.  Plus, I guess, we could kill you fairly easily if we had to silence you, so it's no real loss to us._";
	text2 = "_But ultimately, I want you to know a little bit about what's going on.  When you need to make a choice, it's my hope that you will make the right one if you know why._";
	code = 
		set_flag(21,1,6);
break;

begintalknode 9;
	state = 1;
	nextstate = -1;
	condition = (get_flag(21,1) == 5) && (party_size() > 1);
	question = "Why tell us all of these things?";
	text1 = "_The Immortal said that we could trust you.  Plus, I guess, we could kill you fairly easily if we had to silence you, so it's no real loss to us._";
	text2 = "_But ultimately, I want you to know a little bit about what's going on.  When you need to make a choice, it's my hope that you will make the right one if you know why._";
	code = 
		set_flag(21,1,6);
break;

begintalknode 10;
	state = 1;
	nextstate = -1;
	condition = get_flag(21,1) == 6;
	question = "What choice is that?";
	text1 = "_Sabertooth is powerful.  Previous dealings with him have taught us that.  Unfortunately, he holds all save for the Master in utter disdain.  Thus, it is at a price that we have enlisted his aid._";
	text2 = "_We have made something abhorrent and vile, and that mistake will continue to haunt us all until it is eliminated.  That task, or so we feel, must fall to you._";
	text3 = "_You may not be ready for it, but nobody else is.  Again, I won't tell you any more than this, but...  be prepared for the future._";
	code = 
		set_flag(21,1,7);
break;

begintalknode 11;
	state = 1;
	nextstate = -1;
	condition = get_flag(21,1) == 7;
	question = "What's in the future?";
	text1 = "_For you?  You fight The Immortal!  You will more than likely best him in personal combat, but he will still emerge the victor today._";
	text2 = "_Regardless, he has arranged to fight you.  He wants to know your strength before sending you back to Katothen.  If you are too weak, he will kill you._";
	text3 = "_Do not take him lightly.  Profanus Pyre may have power, but The Immortal has cunning._";
	code = 
		set_flag(22,1,1);
break;

